package com.mask.im.business.controller;
import com.mask.im.business.model.entity.FeedbackType;
import com.mask.im.business.model.dto.FeedbackTypeDTO;
import com.mask.im.business.model.vo.ConditionVO;
import com.mask.im.business.common.model.RestResponse;
import com.mask.im.business.service.FeedbackTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "反馈类型模块")
@RestController
public class FeedbackTypeController{

	@Autowired
	private FeedbackTypeService feedbackTypeService;

	@ApiOperation("添加反馈类型")
	@PostMapping("/admin/feedbackType/add")
	public RestResponse<String> addFeedbackType(@RequestBody FeedbackType feedbackType){
		return feedbackTypeService.addFeedbackType(feedbackType);
	}

	@ApiOperation("修改反馈类型")
	@PutMapping("/admin/feedbackType")
	public RestResponse<String> updateFeedbackType(@RequestBody FeedbackType feedbackType){
		return feedbackTypeService.updateFeedbackType(feedbackType);
	}

	@ApiOperation("删除反馈类型")
	@DeleteMapping("/admin/feedback/type/{id}")
	public RestResponse<String> deleteFeedBackType(@PathVariable Integer id){
		return feedbackTypeService.deleteFeedBackType(id);
	}

	@ApiOperation("后台获取反馈类型")
	@GetMapping("/admin/feedback/type")
	public RestResponse<List<FeedbackTypeDTO>> feedbackTypeList(ConditionVO conditionVO){
		return feedbackTypeService.feedbackTypeList(conditionVO);
	}

	@ApiOperation("获取反馈内容")
	@GetMapping("/users/feedbackType")
	public RestResponse<List<FeedbackType>> getFeedbackType(){
		return feedbackTypeService.getFeedbackType();
	}
}

